import request from '@/utils/request'

export function add(data) {
  return request.post('admin/moduleform/add', data)
}

export function del(data) {
  return request.post('admin/moduleform/del', data)
}

export function edit(data) {
  return request.post('admin/moduleform/edit', data)
}

export function getTablePage(data) {
  return request.post('admin/moduleform/listPage', data)
}

export function tableList(data) {
  return request.post('admin/moduleform/tableList', data)
}

export function loadModuleData(data) {
  return request.post('admin/moduleform/loadModuleData?id=' + data, data)
}

export function getDictList(data) {
  return request.get('admin/dict/getListByCode?code=' + data, data)
}

export function doCrud(data) {
  return request.post('admin/moduleformfield/doCrud?type=' + data.type + '&moduleFormId=' + data.moduleFormId + '&paramsJson=' + data.paramsJson, data)
}

export function doWfCrud(data) {
  return request.post('buss/wf/ins/doCrud?type=' + data.type + '&moduleFormId=' + data.moduleFormId + '&paramsJson=' + data.paramsJson, data)
}

export function getMenusTree(data) {
  return request.get('admin/menu/tree', data)
}

export function fieldProps(data) {
  return request.post('buss/wf/fieldProps?id=' + data, data)
}

export default {add, del, edit, getMenusTree, fieldProps, getTablePage}
